<template>
  <div class="total-container">
    <div class="grid-container">
      <div class="item-box" v-for="item in data" :key="item.name">
        <div class="title">{{ item.field_name }}</div>
        <div class="value">
          <div class="num">{{ item.field_value }}</div>
          <div class="unit">{{ item.unit }}</div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { getYiliaobzgk } from '@/api/socialSecurity'
export default {
  data() {
    return {
      data: null
    }
  },
  mounted() {
    this.getData()
  },
  methods: {
    async getData() {
      const res = await getYiliaobzgk()
      this.data = res.result.data
    }
  }
}
</script>
<style lang="scss" scoped>
.total-container {
  .grid-container {
    margin-top: 20px;
    margin-left: 15px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    row-gap: 30px;
    column-gap: 20px;
  }
  .item-box {
    width: 180px;
    height: 80px;
    background: url('../../img/left-row3-icon1.png') no-repeat center bottom;
    background-size: 180px 52px;
    .title {
      font-family: MicrosoftYaHei;
      font-size: 16px;
      color: #ffffff;
      line-height: 28px;
      text-align: center;
      font-style: normal;
      text-transform: none;
    }
    .value {
      display: flex;
      justify-content: center;
      align-items: baseline;
    }
    .num {
      font-family: YouSheBiaoTiHei;
      font-size: 24px;
      color: #ffde00;
      line-height: 28px;
      text-align: center;
      font-style: normal;
      text-transform: none;
    }
    .unit {
      font-family: MicrosoftYaHei;
      font-size: 14px;
      color: #ffffff;
      line-height: 28px;
      text-align: center;
      font-style: normal;
      text-transform: none;
      margin-left: 3px;
    }
  }
}
</style>
